package com.gywj.race.service;

import com.gywj.race.config.exception.BaseException;
import com.gywj.race.entity.Organizer;
import com.gywj.race.entity.OrganizerExample;
import com.gywj.race.mapper.OrganizerMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * The type Organizer service.
 */
@Service
public class OrganizerService {
    @Resource
    private OrganizerMapper organizerMapper;

    /**
     * 获取主办方列表 下拉框
     *
     * @return the organizer list
     */
    public List<Organizer> getOrganizerList() {
        try {
            List<Organizer> organizers = organizerMapper.selectByExample(new OrganizerExample());
            return organizers;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BaseException(e.getMessage());
        }
    }
}
